<?php
namespace app\index\controller;

class Test extends Base {

	public function set_dealerid() {
		// $page = 1;
		// while ($page < 1000) {
		//     $list = model('AdminUser')->where('roleid', 9)->order('userid desc')->page($page, 20)->select();
		//     if (empty($list)) {
		//         break;
		//     }
		//     foreach ($list as $v) {
		//         if ($v['puserid']) {
		//             $dealerid = model('AdminUser')->where('userid', $v['puserid'])->value('dealerid');
		//             model('AdminUser')->where('userid', $v['userid'])->setField('dealerid', $dealerid);
		//         }
		//     }

		//     $page++;
		//     usleep(1000);
		// }
		$userids = model('AdminUser')->where('userid', 'in', '3091,3091,3091,3091,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,574,257,257,257,78,78,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,29')->order('puserid desc')->column('puserid');
		echo implode(',', $userids);
	}

	public function test_sync() {
		echo exec_php('/index/cron/send_coupons', ['userid' => '13561', 'type' => 'baoyang', 'clientid' => '23']);
	}

}
